package com.suixun.vo;

import java.util.LinkedList;
import java.util.List;
import com.suixun.entity.DeviceInfo;
import com.suixun.util.DateUtil;
public class DeviceVO {
	private String id;
    private String holdname;
    private String mdtid;
    private String cardid;
    private String fee;
    private String fee2;
    private String status;
    private String isinit;
    private String sellerid;
    private String telephone;
    private String addtime;
    private String updatetime;
    private String devicetype;
    private String endtime;
    private String schoolname;
    private String imeimask;
    private String purchaseprice;
    private String factory;
    private String starttime;
    private String paystatus;
    private String batchid;
    private String boxid;
    private String imei;
    private String ids; //需要操作的多个id，之间以逗号分隔
    private String schoolid; //学校id
    private String devicecounts; //装箱量
    private String puttype; //投放类型 1-按箱号，其他按设备
    private String devicetypename;
    private String modifytype;
    private String tablename;
    private String createtime;
    private String province;
    private String city;
    private String town;
    private Integer totalcount;
    private Integer putcount;
    private Integer unputcount;
    private Integer pagenumber = 1; // 当前显示第几页
	private Integer pagecount = 15; // 每页显示的数据条数，缺省为15条
	private Integer islast;//不为null时表示查询最后一次入库
	private String studentname;//学生姓名
	private String parenttel;//家长手机号
	private String teachertel;
	private String classname;//班级
	private String paytime;//设备缴费时间
	private String paymoney;//设备缴费金额
	private Integer authstatus; //实名认证状态
	private String authTime;//实名认证通过时间
	private Integer firewallstatus;//来电防火墙状态
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getHoldname() {
		return holdname;
	}
	public void setHoldname(String holdname) {
		this.holdname = holdname;
	}
	public String getMdtid() {
		return mdtid;
	}
	public void setMdtid(String mdtid) {
		this.mdtid = mdtid;
	}
	public String getCardid() {
		return cardid;
	}
	public void setCardid(String cardid) {
		this.cardid = cardid;
	}
	public String getFee() {
		return fee;
	}
	public void setFee(String fee) {
		this.fee = fee;
	}
	public String getFee2() {
		return fee2;
	}
	public void setFee2(String fee2) {
		this.fee2 = fee2;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getIsinit() {
		return isinit;
	}
	public void setIsinit(String isinit) {
		this.isinit = isinit;
	}
	public String getSellerid() {
		return sellerid;
	}
	public void setSellerid(String sellerid) {
		this.sellerid = sellerid;
	}
	public String getTelephone() {
		return telephone;
	}
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	public String getAddtime() {
		return addtime;
	}
	public void setAddtime(String addtime) {
		this.addtime = addtime;
	}
	public String getUpdatetime() {
		return updatetime;
	}
	public void setUpdatetime(String updatetime) {
		this.updatetime = updatetime;
	}
	public String getDevicetype() {
		return devicetype;
	}
	public void setDevicetype(String devicetype) {
		if(devicetype == null) {
			this.devicetype = null;
		}else if(devicetype.equals("1")) {
			devicetypename= "手表";
		}else if(devicetype.equals("2")) {
	    	devicetypename= "智能学生证";
	    }else if(devicetype.equals("3")) {
    		devicetypename= "考勤卡";
	    }else if (devicetype.equals("8")) {
	    	devicetypename= "13.56";
	    }else if (devicetype.equals("9")) {
	    	devicetypename= "2.4";
	    }	
		this.devicetype = devicetype;
	}
	public String getEndtime() {
		return endtime;
	}
	public void setEndtime(String endtime) {
		this.endtime = endtime;
	}
	public String getSchoolname() {
		return schoolname;
	}
	public void setSchoolname(String schoolname) {
		this.schoolname = schoolname;
	}
	public String getImeimask() {
		return imeimask;
	}
	public void setImeimask(String imeimask) {
		this.imeimask = imeimask;
	}
	public String getPurchaseprice() {
		return purchaseprice;
	}
	public void setPurchaseprice(String purchaseprice) {
		this.purchaseprice = purchaseprice;
	}
	public String getFactory() {
		return factory;
	}
	public void setFactory(String factory) {
		this.factory = factory;
	}
	public String getStarttime() {
		return starttime;
	}
	public void setStarttime(String starttime) {
		this.starttime = starttime;
	}
	public String getPaystatus() {
		return paystatus;
	}
	public void setPaystatus(String paystatus) {
		/*if(paystatus != null) {
			switch(paystatus) {
				case "1":
					paystatus = "未激活";
					break;
				case "2":
					paystatus = "已激活";
					break;
				case "3":
					paystatus = "已缴费";
					break;
				case "4":
					paystatus = "已过期";
					break;
				case "5":
					paystatus = "已回收";
					break;
				default :
					paystatus = null;
			}
		}*/
		this.paystatus = paystatus;
	}
	public String getBatchid() {
		return batchid;
	}
	public void setBatchid(String batchid) {
		this.batchid = batchid;
	}
	public String getBoxid() {
		return boxid;
	}
	public void setBoxid(String boxid) {
		this.boxid = boxid;
	}
	public String getImei() {
		return imei;
	}
	public void setImei(String imei) {
		if(devicetype != null && devicetype.equals("3")){
			this.imei = null;
		}else{
			this.imei = imei;
		}
	}
	public String getIds() {
		return ids;
	}
	public void setIds(String ids) {
		this.ids = ids;
	}
	public String getSchoolid() {
		return schoolid;
	}
	public void setSchoolid(String schoolid) {
		this.schoolid = schoolid;
	}
	public String getDevicecounts() {
		return devicecounts;
	}
	public void setDevicecounts(String devicecounts) {
		this.devicecounts = devicecounts;
	}
	public String getPuttype() {
		return puttype;
	}
	public void setPuttype(String puttype) {
		this.puttype = puttype;
	}
	public String getDevicetypename() {
		return devicetypename;
	}
	public void setDevicetypename(String devicetypename) {
		this.devicetypename = devicetypename;
	}
	public String getModifytype() {
		return modifytype;
	}
	public void setModifytype(String modifytype) {
		this.modifytype = modifytype;
	}
	public String getTablename() {
		return tablename;
	}
	public void setTablename(String tablename) {
		this.tablename = tablename;
	}
	public String getCreatetime() {
		return createtime;
	}
	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}
	public String getProvince() {
		return province;
	}
	public void setProvince(String province) {
		this.province = province;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getTown() {
		return town;
	}
	public void setTown(String town) {
		this.town = town;
	}
	public Integer getTotalcount() {
		return totalcount;
	}
	public void setTotalcount(Integer totalcount) {
		this.totalcount = totalcount;
	}
	public Integer getPutcount() {
		return putcount;
	}
	public void setPutcount(Integer putcount) {
		this.putcount = putcount;
	}
	public Integer getUnputcount() {
		return unputcount;
	}
	public void setUnputcount(Integer unputcount) {
		this.unputcount = unputcount;
	}
	public Integer getPagenumber() {
		return pagenumber;
	}
	public void setPagenumber(Integer pagenumber) {
		this.pagenumber = pagenumber;
	}
	public Integer getPagecount() {
		return pagecount;
	}
	public void setPagecount(Integer pagecount) {
		this.pagecount = pagecount;
	}
	public Integer getIslast() {
		return islast;
	}
	public void setIslast(Integer islast) {
		this.islast = islast;
	}
	public String getStudentname() {
		return studentname;
	}
	public void setStudentname(String studentname) {
		this.studentname = studentname;
	}
	public String getParenttel() {
		return parenttel;
	}
	public void setParenttel(String parenttel) {
		this.parenttel = parenttel;
	}
	public String getTeachertel() {
		return teachertel;
	}
	public void setTeachertel(String teachertel) {
		this.teachertel = teachertel;
	}
	public String getClassname() {
		return classname;
	}
	public void setClassname(String classname) {
		this.classname = classname;
	}
	public String getPaytime() {
		return paytime;
	}
	public void setPaytime(String paytime) {
		this.paytime = paytime;
	}
	public String getPaymoney() {
		return paymoney;
	}
	public void setPaymoney(String paymoney) {
		this.paymoney = paymoney;
	}
	public Integer getAuthstatus() {
		return authstatus;
	}
	public void setAuthstatus(Integer authstatus) {
		this.authstatus = authstatus;
	}
	public String getAuthTime() {
		return authTime;
	}
	public void setAuthTime(String authTime) {
		this.authTime = authTime;
	}
	public Integer getFirewallstatus() {
		return firewallstatus;
	}
	public void setFirewallstatus(Integer firewallstatus) {
		this.firewallstatus = firewallstatus;
	}
	public List<DeviceVO> deviceInfoToVO(List<DeviceInfo> deviceList){
		List<DeviceVO> deviceVOs = new LinkedList<>();
		for(DeviceInfo deviceInfo: deviceList){
			DeviceVO device=new DeviceVO();
			device.setId(String.valueOf(deviceInfo.getId()));
			device.setFactory(deviceInfo.getFactory());
			device.setDevicetype(deviceInfo.getDevicetype() == null ? null : String.valueOf(deviceInfo.getDevicetype()));
			device.setCardid(deviceInfo.getCardid());
			device.setMdtid(deviceInfo.getMdtid());
			device.setFee(deviceInfo.getFee() == null ? null : String.valueOf(deviceInfo.getFee()));
			device.setFee2(deviceInfo.getFee2() == null ? null : String.valueOf(deviceInfo.getFee2()));
			device.setStatus(String.valueOf(deviceInfo.getStatus()));
			device.setTelephone(deviceInfo.getTelephone());
			device.setAddtime(DateUtil.formatDateToString(deviceInfo.getAddtime(), null));
			device.setUpdatetime(DateUtil.formatDateToString(deviceInfo.getUpdatetime(), null));
			device.setEndtime(DateUtil.formatDateToString(deviceInfo.getEndtime(), null));
			device.setSchoolname(deviceInfo.getSchoolname());
			device.setPurchaseprice(deviceInfo.getPurchaseprice() == null ? null : String.valueOf(deviceInfo.getPurchaseprice()));
			device.setStarttime(DateUtil.formatDateToString(deviceInfo.getStarttime(), null));
			device.setPaystatus(deviceInfo.getPaystatus() == null ? null : String.valueOf(deviceInfo.getPaystatus()));
			device.setBatchid(deviceInfo.getBatchid());
			device.setBoxid(deviceInfo.getBoxid());
			device.setImei(deviceInfo.getImei());
			device.setIds(deviceInfo.getIds());
			device.setSchoolid(String.valueOf(deviceInfo.getSchoolid()));
			device.setPuttype(deviceInfo.getPuttype());
			device.setDevicetypename(deviceInfo.getDevicetypename());
			device.setModifytype(deviceInfo.getModifytype());
			device.setTablename(deviceInfo.getTablename());
			device.setCreatetime(deviceInfo.getCreatetime());
			deviceVOs.add(device);
		}
		return deviceVOs;
	}
	
}
